/**  
* <p>Title: ShopServiceImpl.java</p>  
* <p>Description: </p>  
* <p>Copyright: Copyright (c) 2017</p>  
* <p>Company: 黎明</p>  
* @author ltf 
* @date 2019年6月27日  
* @version 1.0  
*/  
package com.liming.service;

import java.util.List;

import com.liming.according.According4Shops;
import com.liming.dao.ShopDao;
import com.liming.model.Goods;
import com.liming.model.GoodsInfo;
import com.liming.model.Shop;
import com.liming.serviceinterface.ShopService;

/**  
* <p>Title: ShopServiceImpl.java</p>  
* <p>Description: </p>  
* <p>Copyright: Copyright (c) 2017</p>  
* <p>Company: 黎明</p>  
* @author ltf 
* @date 2019年6月27日  
* @version 1.0  
*/
public class ShopServiceImpl implements ShopService {
	ShopDao shopdao=new ShopDao();
	/* (non-Javadoc)
	 * @see com.liming.serviceinterface.ShopService#getShopById(int)
	 */
	@Override
	public Shop getShopById(int id) {
		Shop shop=shopdao.getShop(id);
		return shop;
	}

	/* (non-Javadoc)
	 * @see com.liming.serviceinterface.ShopService#getShops(com.liming.according.According4Shops)
	 */
	@Override
	public List<Shop> getShops(According4Shops according) {
		// TODO Auto-generated method stub
		List<Shop> a=shopdao.getShops(according);
		return a;
	}

	/* (non-Javadoc)
	 * @see com.liming.serviceinterface.ShopService#updateShop(com.liming.model.Shop)
	 */
	@Override
	public boolean updateShop(Shop s) {
		int flag=shopdao.updateShop(s);
		if(flag==1) {
			return true;
		}
		return false;
	}

	/* (non-Javadoc)
	 * @see com.liming.serviceinterface.ShopService#publishGoods(com.liming.model.Shop, com.liming.model.Goods, com.liming.model.GoodsInfo)
	 */
	@Override
	public boolean publishGoods(int shopid, Goods g, GoodsInfo gI) {
		if(shopdao.publishGoods(shopid, g, gI)==1) {
			return true;
		}
		return false;
	}

	/* (non-Javadoc)
	 * @see com.liming.serviceinterface.ShopService#closeShop(com.liming.model.Shop)
	 */
	@Override
	public boolean closeShop(int shopid) {
		if(shopdao.closeShop(shopid)==1) {
			return true;
		}
		return false;
	}

	/* (non-Javadoc)
	 * @see com.liming.serviceinterface.ShopService#openShop(com.liming.model.Shop)
	 */
	@Override
	public boolean openShop(Shop s, String username) {

		if(shopdao.openShop(s, username)==1)
		return true;
		return false;
	}

}
